package com.youwe1.wiki.req;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

@Data
public class UserSaveReq {
    private Long id;

    @NotNull(message = "用户名不能为空")
    private String loginName;

    @NotNull(message = "名称不能为空")
    private String name;

    @NotNull(message = "密码不能为空")
    @Length(min = 6, max = 32, message = "【密码】6~32位")
    //前端传过来的md5，所以后端用正则表达式已经无效了
    //@Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$", message = "【密码】至少包含数字和英文，长度6-32位")
    private String password;
}
